package com.epalmpay.service.weixin;

import com.epalmpay.exception.ApplicationException;
import com.epalmpay.entity.Response;

import java.text.ParseException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutionException;

/**
 * Created by lifayi on 2017/10/12.
 */
public interface IWxApiMallService {
    Response advertise(Long groupId);

    Response category(Long groupId);

    Response recommendGood(Long groupId, Integer pageNo, Integer pageSize);

    Response goodDetail(Long goodId);
    Map<String, Object> queryGoodList(Long groupId,
                           Long categoryFirstId,Long categorySecondId,String goodName,Integer sortMethod,Integer pageNo,Integer pageSize) throws Exception;

    Response saveSubmitOrder(Long memberId, Long goodId, Integer goodsNum, Long addressId, Integer bonus,
                             String couponSns,Long specId, Long sharememberid) throws ApplicationException;

    Response saveWalletPay(Long memberId, String orderId, String payPwd, String payRootHomeURL) throws ApplicationException, ExecutionException, InterruptedException;

    Response orderList(Long memberId, Integer orderStatus, Integer pageNo, Integer pageSize);

    Map<String, Object> getCanUsedShopListByCouponId(Long couponId, String user_longitude, String user_latitude) throws Exception;

    Response availableBenefit(Long memberId, Long goodsId, Integer tradeAmt) throws ParseException;

    Response saveWeixinPay(Long memberId, String orderId, String mchCreateIp,String notifyUrl) throws ApplicationException;

    Response saveCardPay(Long memberId, String orderId, Long cardId, String merchantIp) throws ApplicationException;

    Response orderRefund(Long memberId, Long orderId, Integer isReceivedGood, String refundReason, String picUrls);

    Response addressDetail(Long memberId, Long addressId);

    Response getFreight(Long memberId, Long addressId, Long goodsId, Integer goodsNum, Long specId);

    Response saveSubmitCart(Long memberId, ArrayList<Long> goodIds);

    Response saveSubmitCartOrder(Long memberId, ArrayList<Long> goodIds, Long addressId, Integer bonus,
                                 String couponSns) throws ApplicationException;

    Response availableBenefitCart(Long memberId, List<Long> goodIds) throws ParseException;

    Response getFreightCart(Long memberId, Long addressId, ArrayList<Long> goodIds);

	Response availableBenefitByServiceMall(Long memberId, Long goodsId, Integer tradeAmt) throws ParseException;

    Response goodReceived(Long memberId, Long orderId);

    //查询线上优惠券可用商品列表
    public Map<String, Object> queryGoodListByOnlineCouponId( Long couponId) throws Exception;

    int insertCouponUser(String memberId, String goodId, Integer type)throws Exception;

    Map<String,Object> addCouponUser(String memberId, String activityId)throws Exception;

//    Map<String,Object> insertCouponUser(String memberId, String goodId,Integer type)throws Exception;

    //结算计算、分润
    public void computeAmount(String orderNo);
}
